Skip to content

T001: Pre-trust workspace to skip trust dialog#15

Merged
grobomo merged 2 commits intomainfrom
015-T001-pretrust-workspace
Apr 6, 2026
Merged

T001: Pre-trust workspace to skip trust dialog#15
grobomo merged 2 commits intomainfrom
015-T001-pretrust-workspace

Conversation

@grobomo
Copy link
Copy Markdown
Owner

@grobomo grobomo commented Apr 6, 2026

Summary

  • Adds ensure_workspace_trusted() that pre-creates ~/.claude/projects/<slug>/ before launching the interactive Claude session, preventing the "Is this a project you trust?" dialog on first launch in new directories
  • Fixes get_project_logs_dir slug encoding to match Claude Code's actual encoding (re.sub(r'[^a-zA-Z0-9-]', '-', path) instead of only replacing \/:.") — the old encoding missed underscores and other special characters

Test plan

  • 62 existing tests pass
  • Verified encoding matches actual Claude Code project directory names
  • Verified ensure_workspace_trusted creates directory for new paths, no-ops for existing
  • Live test: context-reset into a never-before-opened project directory

grobomo added 2 commits April 5, 2026 22:36
Add ensure_workspace_trusted() that pre-creates ~/.claude/projects/<slug>/
before launching the interactive session. This prevents the "Is this a
project you trust?" dialog from appearing on first launch in new directories.

Also fixes get_project_logs_dir slug encoding to match Claude Code's actual
encoding: regex [^a-zA-Z0-9-] -> '-' instead of only replacing \/:.
The old encoding missed underscores and other special characters.
6 new tests covering:
- Underscore replacement in slug encoding
- Dot replacement in slug encoding
- Hyphen preservation in slugs
- Pre-trust creates directory for new paths
- Pre-trust is idempotent (no error on existing)
- Directory doesn't exist before trust call

68 total tests passing.
@grobomo grobomo merged commit 95a1c14 into main Apr 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant